// 要发请求，就要先下载导入axios
import axios from 'axios'
// 创建一个_fetch副本
const _fetch = axios.create({
  baseURL: process.env.VUE_APP_URL
})

// 请求拦截
_fetch.interceptors.request.use(
  config => {
    return config
  },
  error => {
    return Promise.reject(error)
  }
)

// 响应拦截
_fetch.interceptors.response.use(
  config => {
    return config
  },
  error => {
    return Promise.response(error)
  }
)

export default _fetch
